<?php
$MenuList = Yii::app()->params['menu'];
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo empty($title) ? "" : $title; ?></title>
    <!-- Fontfaces CSS-->
    <link href="static/admin/theme/css/font-face.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet"
          media="all">

    <!-- Bootstrap CSS-->
    <link href="static/admin/theme/vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">

    <!-- Vendor CSS-->
    <link href="static/admin/theme/vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet"
          media="all">
    <link href="static/admin/theme/vendor/wow/animate.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/slick/slick.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/select2/select2.min.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/vendor/vector-map/jqvmap.min.css" rel="stylesheet" media="all">

    <!-- Main CSS-->
    <link href="static/admin/theme/css/theme.css" rel="stylesheet" media="all">
    <link href="static/admin/theme/css/customize.css" rel="stylesheet">

    <!-- Jquery JS-->
    <script src="static/admin/theme/vendor/jquery-3.2.1.min.js"></script>

</head>
<body class="animsition">
<div class="page-wrapper">
    <!-- MENU SIDEBAR-->
    <aside class="menu-sidebar2 d-none d-lg-block">
        <div class="logo">
            <a href="#">
                <img src="static/admin/theme/images/icon/logo-white.png"/>
            </a>
        </div>
        <div class="menu-sidebar2__content js-scrollbar1">
            <nav class="navbar-sidebar2">
                <ul class="list-unstyled navbar__list">
                    <?php
                    foreach ($MenuList as $m) {
                        if (sizeof($m['child']) > 0) {
                            ?>
                            <li class=" has-sub">
                                <a class="js-arrow" href="#">
                                    <?php echo $m['name']; ?>
                                    <span class="arrow">
                                    <i class="fa fa-angle-down"></i>
                                </span>
                                </a>
                                <ul class="list-unstyled navbar__sub-list js-sub-list">
                                    <?php
                                    foreach ($m['child'] as $i) {
                                        ?>
                                        <li>
                                            <a href="<?php echo $i['url']; ?>">
                                                <i class="fa fa-caret-right"></i><?php echo $i['name']; ?></a>
                                        </li>
                                        <?php
                                    }
                                    ?>
                                </ul>
                            </li>

                            <?php
                        }
                    }
                    ?>
                </ul>
            </nav>
        </div>
    </aside>
    <!-- END MENU SIDEBAR-->

    <!-- PAGE CONTAINER-->
    <div class="page-container2">
        <!-- HEADER DESKTOP-->
        <header class="header-desktop">
            <div class="section__content section__content--p30">
                <div class="container-fluid">
                    <div class="header-wrap2">
                        <div class="header-button2">
                            <div class="account-wrap">
                                <div class="account-item clearfix js-item-menu">
                                    <div class="content">
                                        <a class="js-acc-btn" href="#"><?php echo Yii::app()->session ['user']['loginname']; ?></a>
                                    </div>
                                    <div class="account-dropdown js-dropdown">
                                        <div class="account-dropdown__body">
                                            <div class="account-dropdown__item">
                                                <a  href="index.php?r=admin/admin/config"><i class="fa fa-cog"></i>个人设置</a>
                                            </div>
                                            <div class="account-dropdown__item">
                                                <a  href="index.php?r=admin/admin/showchangepwd"><i class="fa fa-key"></i>修改密码</a>
                                            </div>
                                        </div>
                                        <div class="account-dropdown__footer">
                                            <a href="index.php?r=admin/default/logout">
                                                <i class="zmdi zmdi-power"></i>退出登入</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </header>
        <!-- END HEADER DESKTOP-->

        <?php echo $content; ?>

    </div>

</div>

<!-- Bootstrap JS-->
<script src="static/admin/theme/vendor/bootstrap-4.1/popper.min.js"></script>
<script src="static/admin/theme/vendor/bootstrap-4.1/bootstrap.min.js"></script>
<!-- Vendor JS       -->
<script src="static/admin/theme/vendor/slick/slick.min.js">
</script>
<script src="static/admin/theme/vendor/wow/wow.min.js"></script>
<script src="static/admin/theme/vendor/animsition/animsition.min.js"></script>
<script src="static/admin/theme/vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
</script>
<script src="static/admin/theme/vendor/counter-up/jquery.waypoints.min.js"></script>
<script src="static/admin/theme/vendor/counter-up/jquery.counterup.min.js">
</script>
<script src="static/admin/theme/vendor/circle-progress/circle-progress.min.js"></script>
<script src="static/admin/theme/vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="static/admin/theme/vendor/chartjs/Chart.bundle.min.js"></script>
<script src="static/admin/theme/vendor/select2/select2.min.js">
</script>
<script src="static/admin/theme/vendor/vector-map/jquery.vmap.js"></script>
<script src="static/admin/theme/vendor/vector-map/jquery.vmap.min.js"></script>
<script src="static/admin/theme/vendor/vector-map/jquery.vmap.sampledata.js"></script>
<script src="static/admin/theme/vendor/vector-map/jquery.vmap.world.js"></script>

<!-- Main JS-->
<script src="static/admin/theme/js/main.js"></script>

<script src="static/admin/lib/bootstrapvalidator/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script src="static/admin/lib/jquery.form.min.js" type="text/javascript"></script>
<script src="static/admin/lib/bootstrap-growl/jquery.bootstrap-growl.js"></script>
<script src="static/admin/lib/bootstrap-dialog/js/bootstrap-dialog.min.js"></script>
<script src="static/admin/lib/global.js" type="text/javascript"></script>

<script type="text/javascript">
    function changeMgrLang() {
        var lang = $("select[name=mgrlang]").val();
        $.get('index.php?r=admin/console/mgrlang&lang=' + lang, null, function (result) {
            if (result.type == true) {
                window.location.reload();
            }
        }, 'json');
    }
    function loadContent(url) {
        $("#div_container").load(url);
    }
    function initHref() {
        $(".user-tools .t").on('click',function (event) {
            event.preventDefault();
            var href = $(this).attr("href");
            loadContent(href);
        });
    }
</script>
</body>
</html>